-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC-4464 examples for llen, lpop, lpush, lrange, rpop, and rpush #3234
base: master
Are you sure you want to change the base?
DOC-4464 examples for llen, lpop, lpush, lrange, rpop, and rpush #3234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use better variable names for the examples.
lLenResult1, err := rdb.LPush(ctx, "mylist", "World").Result() | ||
|
||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
fmt.Println(lLenResult1) // >>> 1 | ||
|
||
lLenResult2, err := rdb.LPush(ctx, "mylist", "Hello").Result() | ||
|
||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
fmt.Println(lLenResult2) // >>> 2 | ||
|
||
lLenResult3, err := rdb.LLen(ctx, "mylist").Result() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change and use better variable names? For example, when the result is from LPush
, if you would like to follow the same naming you do in other examples, makes sense the variable to be named lPushResult
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change and use better variable names? For example, when the result is from
LPush
, if you would like to follow the same naming you do in other examples, makes sense the variable to be namedlPushResult
@ndyakov As with the set commands, the result variable name comes from the name of the command that the example is for (in this case, all the code in the example is for the LLEN
page, so the vars are lLenResultxx
). With the LPUSH
example, it's just a coincidence that the first command in the code is an lpush(...)
, which is why the var name relates to the command there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see... Maybe we can use other naming convention? At least for me it was misleading having lLenResult2
as a result of LPush
.
DOC-4464, DOC-4469, DOC-4474, DOC-4479, DOC-4489, and DOC-4484.
Go versions of the examples for
LLEN
,LPOP
,LPUSH
,LRANGE
,RPOP
, andRPUSH
.